{template 'common/header'}
<link rel="stylesheet" href="../addons/kuyuan_fm/dist/web/common.css" />
<link rel="stylesheet" href="../addons/kuyuan_fm/dist/web/order.css" />
<div id="louie" data-url="{php echo $this->createWebUrl('api')}">

    <!--S头部-->
    <div id="header">
        <h2><i class="iconfont icon-dingdanliebiao"></i>订单列表</h2>
    </div>
    <!--E头部-->

    <!--S列表-->
    <table class="table table-hover">
        <tr>
            <th>订单编号</th>
            <th>收货人</th>
            <th>收货地址</th>
            <th>商品</th>
            <th>数量</th>
            <th>商品快照</th>
            <th>状态</th>
            <th>下单时间</th>
            <th>操作</th>
        </tr>
        <tr v-for="(item,index) in list" :key="item.id">
            <td>{{item.order_id}}</td>
            <td>{{item.take_name}} {{item.take_phone}}</td>
            <td>{{item.address}}</td>
            <td>{{item.name}}</td>
            <td>{{item.number}}</td>
            <td>
                <button type="button" class="btn btn-primary btn-xs" @click="showSnapshot(item.order_id)">查看</button>
            </td>
            <td>
                <button v-if="item.status === '1'" type="button" class="btn btn-warning btn-xs">待发货</button>
                <button v-if="item.status === '2'" type="button" class="btn btn-info btn-xs">待收货</button>
                <button v-if="item.status === '3'" type="button" class="btn btn-success btn-xs">完成</button>
                <button v-if="item.status === '4'" type="button" class="btn btn-danger btn-xs">取消</button>
            </td>
            <td>{{item.create_time}}</td>
            <td>
                    <button type="button" class="btn btn-info btn-xs" :disabled="item.status === '1' ? false : true" @click="confirmTake(index)">发货</button>
                    <button type="button" class="btn btn-danger btn-xs" :disabled="item.status === '1' ? false : true" @click="cancel(index)">取消</button>
            </td>
        </tr>
        <tr class="empty" v-if="list.length <= 0"><td colspan="9">暂无数据</td></tr>
    </table>

    <pageing v-on:change-page="changePage" v-bind:total="total" v-bind:return-num="returnNum"></pageing>
    <!--E列表-->

    <!--S商品详情快照-->
    <modal id="snapshot" name="snapshot" height="auto" :scrollable="true">
        <h2>商品快照</h2>
        <div id="box">
            <p class="name">{{snapshot.name}}</p>
            <p class="price">{{setting.currency_name}}：{{snapshot.price}}</p>
            <div class="images" v-for="item in snapshot.images" :key="item">
                <img @mousedown.prevent :src="item" />
            </div>
        </div>
    </modal>
    <!--E商品详情快照-->

    <!--提示框--><v-dialog style="z-index:99999999;"/>
</div>
<script src="../addons/kuyuan_fm/dist/web/common.js"></script>
<script src="../addons/kuyuan_fm/dist/web/order.js"></script>
{template 'common/footer'}